package jyj.springmvc.learning.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author 老顽固小可爱
 * @Date 2022/12/11 22:38
 * @Version 1.0
 */
@Controller
public class FormalParamController {
    /**
     * 跳转到 user.html
     *
     * @return
     */
    @RequestMapping("/user")
    public String sayHello() {
        return "user";
    }

    /**
     * 通过形参获取请求参数
     *
     * @param userId
     * @param userName
     * @param password
     * @return
     */
    @RequestMapping("/getFormalParam")
    public String getFormalParam(String userId, String userName, String password) {
        System.out.println("userId：" + userId);
        System.out.println("userName：" + userName);
        System.out.println("password：" + password);
        return "success";
    }
}
